libvchan: handle libxc evtchn failures properly in init functions
authorMatthew Daley <mattjd@gmail.com>
Thu, 31 Oct 2013 03:41:32 +0000 (16:41 +1300)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 31 Oct 2013 21:55:53 +0000 (21:55 +0000)
commitf2f06a2f1b42d27dccf08d8ff887c96608b8c6b7
treefe5821fb057bce1f2a9208ab41fa9cbc90df18b5
parent93700cb6b403ca07e55468fbf258fad07c9e99ea
libvchan: handle libxc evtchn failures properly in init functions

The reasoning behind this patch is that ctrl->event_port is a uint32_t
(ie. unsigned), so the current checks on it for negative error results,
non-negative port presence etc. are incorrect.

Fix by using evtchn_port_or_error_t in the init functions instead,
adjusting the error handling, and removing the now-unnecessary check
from the close function.

Coverity-ID: 1055609
Coverity-ID: 1055610
Coverity-ID: 1055611
Signed-off-by: Matthew Daley <mattjd@gmail.com>
Reviewed-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libvchan/init.c
tools/libvchan/io.c